The present invention relates generally to an apparatus in which an objective pattern is extracted by an image sensor, such as a television camera, then subjected to image processing to detect a rotational angle in order to inspect or recognize an objective pattern.
One conventional detection system utilizes a method, known as the moment of inertia method of calculation, in which an optically-sensed pattern is binary coded, and in which a main axis and a center of gravity of an equivalent ellipse are obtained from calculations using the linear moments, quadratic moments geometric moments and an area of the binary-coded pattern.
Thus, a rotational angle .theta. and a center of gravity P.sub.G (P.sub.GX, P.sub.GY) are obtained through the following expressions (1) and (2): EQU tan 2.theta.=2I.sub.xy /(I.sub.y -I.sub.x) (1) EQU P.sub.GX =M.sub.x /A, P.sub.GY =M.sub.y /A (2)
where the various symbols are defined as follows:
M.sub.x : the linear moment of the pattern with respect to the x-axis; PA1 M.sub.y : the linear moment of the pattern with respect to the y-axis; PA1 I.sub.x : the quadratic moment of the pattern with respect to the x-axis; PA1 I.sub.y : the quadratic moment of the pattern with respect to the y-axis; PA1 I.sub.xy : the synergistic moment of the pattern; PA1 A: the area of the objective pattern; and PA1 .theta.: the rotational angle.
Using this moment of inertia method of calculation, the rotational angle .theta. can be detected with relatively high accuracy for an elongated objective pattern, but not for an objective pattern which is more square or circular. In square or circular patterns, the quadratic moments I.sub.x and I.sub.y have similar values, and very small errors in quantization of the pattern are magnified when the denominator at the right hand side of the above-mentioned expression (1) approaches zero. Therefore, if rotation of an objective pattern is normalized by using a rotational angle obtained by the moment of inertia method described above, large errors could occur due to the introduction of errors based on shape-dependent calculations rendering any further pattern inspection and recognition of little practical use.